import request from '@/utils/request'

//课件分类管理-分类树(BOSS)
export function getCategoryTree(data) {
    return request({
        url: '/boss/tc-category/tc-category-tree',
        method: 'post',
        data: data
    })
}
//保存提交课件
export function saveCategoryTree(data) {
    return request({
        url:data.categoryId?'/boss/tc-category/tc-category-edit':'/boss/tc-category/tc-category-add',
        method: 'post',
        data: data
    })
}
//删除课件
export function delCategoryTree(data) {
    return request({
        url:'/boss/tc-category/tc-category-delete',
        method: 'post',
        data: data
    })
}
//移动课件
export function moveCategoryTree(data) {
    return request({
        url:'/boss/tc-category/tc-category-move',
        method: 'post',
        data: data
    })
}



//新增课件(BOSS)
export function saveCourse(data) {
    return request({
        url:data.courseId?'/boss/tc-course/tc-course-edit':'/boss/tc-course/tc-course-add',
        method: 'post',
        data: data
    })
}

//编辑课件(BOSS)
export function editCourse(data) {
    return request({
        url: '/boss/tc-course/tc-course-edit',
        method: 'post',
        data: data
    })
}



//删除课件(BOSS)
export function delCourse(data) {
    return request({
        url: '/boss/tc-course/tc-course-delete',
        method: 'post',
        data: data
    })
}
//启用禁用课件(BOSS)
export function enableCourse(data) {
    return request({
        url: '/boss/tc-course/tc-course-enable',
        method: 'post',
        data: data
    })
}


//审核课件(BOSS)
export function approveCourse(data) {
    return request({
        url:data.id?'/boss/tc-course-approve/tc-course-approve-ok':'/boss/tc-course-approve/tc-course-approve-reject',
        method: 'post',
        data: data
    })
}

//获取学校列表(BOSS)
export function getSchoolsTree(data) {
    return request({
        url: '/boss/schools/schools-tree-list',
        method: 'post',
        data: data
    })
}

//保存提交学校
export function saveSchoolsTree(data) {
    return request({
        url:data.creatorId?'/boss/schools/schools-edit':'/boss/schools/schools-add',
        method: 'post',
        data: data
    })
}

//删除学校
export function delSchoolsTree(data) {
    return request({
        url:'/boss/schools/schools-delete',
        method: 'post',
        data: data
    })
}


//新增用户
export function saveUsers(data) {
    return request({
        url:data.userId?'/boss/users/users-edit':'/boss/users/users-add',
        method: 'post',
        data: data
    })
}

//删除用户
export function deleteUsers(data) {
    return request({
        url:'/boss/users/users-delete',
        method: 'post',
        data: data
    })
}

//获取学校列表
export function getSchoolsList(data) {
    return request({
        url:'/boss/schools/schools-list',
        method: 'post',
        data: data
    })
}


//导出课件报表(BOSS)
export function getExport(data) {
    return request({
        url:'/boss/tc-course/export',
        method: 'post',
        responseType: 'blob',
        data: data
    })
}


//新增角色
export function saveRole(data) {
    return request({
        url:data.id?'/boss/sys_role/update_item':'/boss/sys_role/add_item',
        method: 'post',
        data: data,
        params:data
    })
}
//删除角色
export function deleteRole(data) {
    return request({
        url:'/boss/sys_role/delete_item',
        method: 'post',
        data: data
    })
}

//角色列表
export function getRoleList(data) {
    return request({
        url:'/boss/sys_role/query_list',
        method: 'post',
        data: data,
        params:data
    })
}



//新增账号角色
export function saveUserInfo(data) {
    return request({
        url:data.id?'/boss/boss_user/update_item':'/boss/boss_user/add_item',
        method: 'post',
        data: data,
        params:data
    })
}

//删除账号角色
export function deleteUserInfo(data) {
    return request({
        url:'/boss/boss_user/delete_item',
        method: 'post',
        data: data
    })
}
//重置密码
export function reSetPws(data) {
    return request({
        url:'/boss/teacher-account/boss-reset-password',
        method: 'get',
        data: data,
        params:data
    })
}


//获取后台用户关联模块
export function getMeun(data) {
    return request({
        url:'/boss/teacher-account/bossuser-model-list',
        method: 'post',
        data: data,
    })
}


//新增教师账户信息
export function saveAccount(data) {
    return request({
        url:data.id?'/boss/boss_user/update_item':'/boss/teacher-account/add',
        method: 'post',
        data: data,
        params:data
    })
}

//新增教师账户信息-用户中心
export function saveDataAccount(data) {
    return request({
        url:data.id?'/boss/boss_user/update_item':'/boss/boss_user/add_item',
        method: 'post',
        data: data,
        params:data
    })
}


//变更教师状态
export function changeAccountStatus(data) {
    return request({
        url:'/boss/teacher-account/change-enable-status',
        method: 'post',
        data: data,
        params:data
    })
}



//变更教师状态
export function changeUSersStatus(data) {
    return request({
        url:'/boss/boss_user/update_item',
        method: 'post',
        data: data,
        params:data
    })
}



//用户中心-用户列表
export function setUsersStatus(data) {
    return request({
        url:'/boss/users/change-users-status',
        method: 'post',
        data: data,
        params:data
    })
}

//新增职务
export function savePosition(data) {
    return request({
        url:data.usersPositionId?'/boss/users-position/users-position-edit':'/boss/users-position/users-position-add',
        method: 'post',
        data: data,
        params:data
    })
}



//删除职务
export function deletePosition(data) {
    return request({
        url:'/boss/users-position/users-position-delete',
        method: 'post',
        data: data
    })
}


//职务列表
export function getPositionSelect(data) {
    return request({
        url:'/boss/users-position/users-position-list',
        method: 'post',
        data: data
    })
}